package com.fortune.dao;

import com.fortune.dto.in.channelDiscount.ChannelDiscountAddDto;
import com.fortune.dto.in.channelDiscount.ChannelDiscountEditDto;
import com.fortune.dto.in.channelDiscount.ChannelDiscountListDto;
import com.fortune.vo.channelDiscountMgt.ChannelDiscount;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ChannelDiscountMgtDao {
    /**
     * 优惠政策列表
     * @param companyId
     * @param channelDiscountListDto
     * @return
     */
    List<ChannelDiscount> queryChannelDiscountList(@Param("companyId") String companyId, @Param("channelDiscountListDto") ChannelDiscountListDto channelDiscountListDto);

    /**
     * 优惠政策列表
     * @param companyId
     * @param channelDiscountListDto
     * @return
     */
    int queryChannelDiscountListCount(@Param("companyId") String companyId, @Param("channelDiscountListDto") ChannelDiscountListDto channelDiscountListDto);

    /**
     * 根据优惠名称查找数据是否存在
     * @param companyId
     * @param name
     * @return
     */
    int queryChannelDiscountCountByName(@Param("companyId") String companyId, @Param("name") String name);

    /**
     * 添加优惠政策
     * @param companyId
     * @param addDto
     * @return
     */
    int addChannelDiscountCount(@Param("companyId") String companyId, @Param("addDto") ChannelDiscountAddDto addDto);

    /**
     * 删除优惠政策
     * @param companyId
     * @param channelDiscountId
     * @return
     */
    int deleteChannelDiscountCount(@Param("companyId") String companyId, @Param("channelDiscountId") String channelDiscountId);

    /**
     * 编辑时查看是否存在
     * @param companyId
     * @param editDto
     * @return
     */
    int queryIsExist(@Param("companyId") String companyId, @Param("editDto") ChannelDiscountEditDto editDto);

    /**
     * 编辑优惠政策
     * @param companyId
     * @param editDto
     * @return
     */
    int editChannelDiscountCount(@Param("companyId") String companyId, @Param("editDto") ChannelDiscountEditDto editDto);
}
